<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
    <script>
        let opt={
            el:"#app",
            data:{
                msg:"测试消息msg",
                users:[
                    {name:"tom",age:23},
                    {name:"jack",age:33},
                    {name:"rick",age:18}
                ]
            },
            methods:{
                removeUser:function(i){
                    this.users.splice(i,1)
                }
            }
        }
        window.onload=function(){
            let v=new Vue();
            console.log(v);
            new Vue({
                el:'#root',
                data:{
                    msg:"haha"
                },
                methods:{

                }
            })
        }
    </script>
</head>
<body>
    <div id="root">
        <h1>{{msg}}</h1>
        <ol>
            <li v-show="user.length==0">无用户信息</li>
            <li v-for="(u,i) in users">
                姓名：{{u.name}}
                <input type="button" value="删除" v-on:click="removeUser(i)">
            </li>
        </ol>
    </div>
</body>
</html>